/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aeronef.model;

import com.jme3.app.state.AppStateManager;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Hagan
 */
public class Turret extends AeronefNode {
    
    private Float traverseRate = 0f;
    private Float traversePos = 0f;
    private Float traverseArc = 0f;
    private Float elevateRate = 0f;
    
    private List<Gun> guns = new ArrayList<Gun>();
    
    public Turret(AppStateManager stateManager ) {
        super(stateManager);
    }
    
    public enum Rotation { CLOCKWISE, COUNTER_CLOCKWISE }
    
    public void elevate() {
        for (Gun gun : guns) {
            gun.rotate(-elevateRate,0,0);
        }
    }
    
    public void depress() {
        for (Gun gun : guns) {
            gun.rotate(elevateRate,0,0);
        }
    }
    
    public void shoot() {
        for (Gun gun : guns) {
            gun.shoot();
        }
    }

    public List<Gun> getGuns() {
        if (guns == null) { return new ArrayList<Gun>(); }
        return guns;
    }
    
    public Float getTraverseArc() { return traverseArc; }
    public Float getTraversePos() { return traversePos; }
    public Float getTraverseRate() { return traverseRate; }
    
    public Float getElevateRate() { return elevateRate; }
    
    public void setGuns(List<Gun> guns) { this.guns = guns; }
    
    public void setTraverseArc(Float traverseArc) { this.traverseArc = traverseArc; }
    public void setTraversePos(Float traversePos) { this.traversePos = traversePos; }
    public void setTraverseRate(Float traverseRate) { this.traverseRate = traverseRate; }
    
    public void setElevateRate(Float elevateRate) { this.elevateRate = elevateRate; }
}
